<?
#####################################################
#  COPYRIGHT NOTICE
#####################################################
# In the following statements, the term "this 
# program" refers to all files associated with the
# execution and distribution of Adtrackz.
#
# This Program is Copyright 2004 Jonah Klimack.
# All Rights Reserved. 
#
# Selling the code for this program, modifying 
# and/or redistributing the code for this program
# in part or in whole over the Internet or in any 
# other medium is expressly forbidden. Violators
# will be prosecuted to the fullest extent of the law
# Copyright and header information may not be
# modified.
#s
# This program is distributed "as is" and without 
# warranty of any kind, either express or implied.
# In no event shall the liability of Jonah Klimack 
# for any damages, losses and/or causes of 
# action exceed the total amount paid by the 
# user for this software.		
#####################################################
# DO NOT MODIFY ANYTHING IN THIS FILE
#####################################################



require "header.php";

$datafeed = fetchUrl ("http://www.adtrackz.com/support/versionget.txt");

if ($datafeed)
{
	$contents = explode("Version", $datafeed);
	$version = $contents[1];
}
else
	$version = "Could not retrieve version information, please visit our support center for version information.";

?>

<p class="small" align="left">
Help > Version
</p>
<p class="heading">
AdTrackzGold Version
</p>


<p>You are currently running AdTrackzGold Version 3.40, launched June 14th, 2005.</p>

<p>Latest Version is: <b> 
  <?=$version?>
  </b></p>
<p> 
  <?

require "footer.php";



function fetchUrl($url)
{
	// Set maximum number of seconds (can have floating-point) to wait for feed before displaying page without feed
	$numberOfSeconds=2;   

	// Suppress error reporting so Web site visitors are unaware if the feed fails
	error_reporting(0);

	// Extract resource path and domain from URL ready for fsockopen
	$url = str_replace("http://","",$url);
	$urlComponents = explode("/",$url);
	$domain = $urlComponents[0];
	$resourcePath = str_replace($domain,"",$url);

	// Establish a connection
	$socketConnection = fsockopen($domain, 80, $errno, $errstr, $numberOfSeconds);

	if (!$socketConnection) //didn't connect for whatever reason
	{
		return 0;
	}
	else    
	{
		$xml = '';
		fputs($socketConnection, "GET /$resourcePath HTTP/1.0\r\nHost: $domain\r\n\r\n");
		
		// Loop until end of file
		while (!feof($socketConnection))
			$xml .= fgets($socketConnection, 128);
		fclose ($socketConnection);

		return($xml);
	}	
}    

?>
</p>

